<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
				
			/* #divId{
				width:100px ;
				height: 100px;
				background-color: aqua
				
			} */
		</style>
	</head>
	<body>
		<div id="divId">
			
		<img src="img/1.jpg" >
      <tr>
			<td id="jp1"><img src="img/.jpg" ></td>
	
         
			 
		  
			
		</tr>
		</div>
		<button type="button" onclick="goji();">开始</button>
	</body>
<script type="text/javascript">
		function goji(){
			// event.target.innerText = '抽奖中...';
			var imgObj = document.getElementById('divId');
			
						
						
		
			var addimg = document.getElementsByTagName('img');
			for(var i=0;i<addimg.length;i++){
			}
			setTimeout(function(){
				var ranimg  = getRandValidNum();
				console.log('公布抽奖结果:'+ranimg);
			
			},100);
		}
		//递归
		function getRandValidNum(){
			while(true){
				var randNum = Math.floor(Math.random()*10);
				if(randNum!=0){
					return randNum;
				}
			}				
		}
	</script>
</html>
 